package com.kgdev.cweb.entities.prod.managed;

  import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.TableGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.kgdev.cweb.entities.ManagedEntity;
import com.kgdev.cweb.entities.prod.owned.client.ClientShippingInfo;
import com.kgdev.cweb.entities.pub.ChocolateColor;
import com.kgdev.cweb.entities.pub.ChocolateColorBody;
import com.kgdev.cweb.entities.pub.ChocolateType;
import com.kgdev.cweb.entities.pub.PlateArticle;
import com.kgdev.cweb.entities.pub.PlatePacking;
import com.kgdev.cweb.entities.pub.ShipingType;
import com.kgdev.cweb.entities.sys.Image;

/**
 * The persistent class for the order_draft database table.
 * 
 */
@Entity
@NamedQueries(value = {
		@NamedQuery(name = "OrderDraft.findAll", query = "select o from OrderDraft o"),
		@NamedQuery(name = "OrderDraft.idExists", query = "select count(o) from OrderDraft o where o.orderDraftId = :orderDraftId") })
@Table(name = "prod_order_draft")
public class OrderDraft implements Serializable, ManagedEntity {
	private static final long serialVersionUID = 1L;

	@Id
	@TableGenerator(name = "PROD_ORD_DRFT", allocationSize = 1, initialValue = 1, table = "SEQUENCE", valueColumnName = "SEQ_COUNT", pkColumnName = "SEQ_NAME", pkColumnValue = "PROD_ORD_DRFT")
	@GeneratedValue(strategy = GenerationType.TABLE, generator = "PROD_ORD_DRFT")
	@Column(name = "order_draft_id", unique = true, nullable = false)
	private Integer orderDraftId;

	@Column(length = 45)
	private String inscription;

	@ManyToOne(cascade = CascadeType.ALL)
	@JoinColumn(name = "logotype_id")
	private Image logotype;

	@Column(name = "has_frame")
	private Boolean hasFrame;

	@Column(name = "order_name", length = 45)
	private String orderName;

	@ManyToOne
	@JoinColumn(name = "client_shipping_id")
	private ClientShippingInfo clientShippingInfo;

	@ManyToOne
	@JoinColumn(name = "shipping_type")
	private ShipingType shippingType;

	@OneToOne
	@JoinColumn(name = "edit_order_id")
	private Order editOrder;

	@Column(name = "quantity")
	private Integer quantity;

	@ManyToOne
	@JoinColumn(name = "chocolate_type_id")
	private ChocolateType chocolateType;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "order_draft_date")
	private Date orderDraftDate;

	// bi-directional many-to-one association to Client
	@ManyToOne
	@JoinColumn(name = "client_id")
	private Client client;

	@ManyToOne
	@JoinColumn(name = "plate_article_id")
	private PlateArticle plateArticle;

	@ManyToOne
	@JoinColumn(name = "plate_packing_id")
	private PlatePacking platePacking;

	@ManyToOne
	@JoinColumn(name = "logo_colour")
	private ChocolateColor logoColor;

	@ManyToOne
	@JoinColumn(name = "plato_colour")
	private ChocolateColor plateColor;

	@ManyToOne
	@JoinColumn(name = "inscription_colour")
	private ChocolateColor inscriptionColor;

	@ManyToOne
	@JoinColumn(name = "body_colour")
	private ChocolateColorBody bodyColor;

	// bi-directional many-to-one association to Order
	@ManyToOne
	@JoinColumn(name = "parent_order_id")
	private Order parentOrder;

	public ChocolateColorBody getBodyColor() {
		return bodyColor;
	}

	public ChocolateType getChocolateType() {
		return chocolateType;
	}

	public Client getClient() {
		return client;
	}

	public Order getEditOrder() {
		return editOrder;
	}

	public Boolean getHasFrame() {
		return hasFrame;
	}

	public String getInscription() {
		return inscription;
	}

	public ChocolateColor getInscriptionColor() {
		return inscriptionColor;
	}

	public ChocolateColor getLogoColor() {
		return logoColor;
	}

	public Image getLogotype() {
		return logotype;
	}

	public Date getOrderDraftDate() {
		return orderDraftDate;
	}

	public Integer getOrderDraftId() {
		return orderDraftId;
	}

	public String getOrderName() {
		return orderName;
	}

	public Order getParentOrder() {
		return parentOrder;
	}

	public PlateArticle getPlateArticle() {
		return plateArticle;
	}

	public ChocolateColor getPlateColor() {
		return plateColor;
	}

	public PlatePacking getPlatePacking() {
		return platePacking;
	}

	public Integer getQuantity() {
		return quantity;
	}

	public ShipingType getShippingType() {
		return shippingType;
	}

	public void setBodyColor(ChocolateColorBody bodyColor) {
		this.bodyColor = bodyColor;
	}

	public void setChocolateType(ChocolateType chocolateType) {
		this.chocolateType = chocolateType;
	}

	public void setClient(Client client) {
		this.client = client;
	}

	public void setEditOrder(Order editOrder) {
		this.editOrder = editOrder;
	}

	public void setHasFrame(Boolean hasFrame) {
		this.hasFrame = hasFrame;
	}

	public void setInscription(String inscription) {
		this.inscription = inscription;
	}

	public void setInscriptionColor(ChocolateColor inscriptionColor) {
		this.inscriptionColor = inscriptionColor;
	}

	public void setLogoColor(ChocolateColor logoColor) {
		this.logoColor = logoColor;
	}

	public void setLogotype(Image logotype) {
		this.logotype = logotype;
	}

	public void setOrderDraftDate(Date orderDraftDate) {
		this.orderDraftDate = orderDraftDate;
	}

	public void setOrderDraftId(Integer orderDraftId) {
		this.orderDraftId = orderDraftId;
	}

	public void setOrderName(String orderName) {
		this.orderName = orderName;
	}

	public void setParentOrder(Order parentOrder) {
		this.parentOrder = parentOrder;
	}

	public void setPlateArticle(PlateArticle plateArticle) {
		this.plateArticle = plateArticle;
	}

	public void setPlateColor(ChocolateColor plateColor) {
		this.plateColor = plateColor;
	}

	public void setPlatePacking(PlatePacking platePacking) {
		this.platePacking = platePacking;
	}

	@Override
	public String toString() {
		return "OrderDraft [orderDraftId=" + orderDraftId + ", orderName="
				+ orderName + ", orderDraftDate=" + orderDraftDate
				+ ", plateArticle=" + plateArticle + "]";
	}

	public void setQuantity(Integer quantity) {
		this.quantity = quantity;
	}

	public void setShippingType(ShipingType shippingType) {
		this.shippingType = shippingType;
	}

	public ClientShippingInfo getClientShippingInfo() {
		return clientShippingInfo;
	}

	public void setClientShippingInfo(ClientShippingInfo clientShippingInfo) {
		this.clientShippingInfo = clientShippingInfo;
	}

}